<%@page import="com.ddd.entity.Publisher"%>
<%@page import="com.ddd.service.PublisherService"%>
<%@page import="com.ddd.entity.Article"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.ddd.service.ArticleService"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
    String name = request.getParameter("name");
    String volume = request.getParameter("volume");
    String issue = request.getParameter("issue");
    String year = request.getParameter("year");

    Parameters para = new Parameters(request);
    String username = para.getUsername();

    PublisherService service = new PublisherService(request);
    Publisher p = service.loadByName(username);

    ArticleService articleService = new ArticleService(request);
    ArrayList list = articleService.search(name, volume, issue, year, p.getId());

%>

<html xmlns="http://www.w3.org/1999/xjsp">
    <head>
        <meta http-equiv="Content-Type" content="text/jsp; charset=utf-8" />
        <title>文章列表</title>
        <link href="../style.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            <!--
            body {
                background-image: url(../images/back-200.gif);
            }
            -->
        </style></head>

    <body>

        <div id="cell">
            <div id="cell2"></div>
            <div id="cell3">
                <div id="cell4"><div  align="center" id="long"  > </div></div>
                <div id="cell5">
                    <div  align="center">
                        <%@ include file="../menu.jsp" %>
                    </div>
                </div>
                <div id="cell11">
                    <div id="cell6">
                        <form action="" method="post"  id="froml">
                            <div id="menu">
                                <ul class="subb">
                                    <li><a href="<%=request.getContextPath()%>/FE/Search/Search.jsp" target="_self" class="article"></a></li>
                                    <li><a href="<%=request.getContextPath()%>/FE/Search/journal.jsp" target="_self" class="journal"></a></li>
                                </ul>
                            </div>
                        </form>
                    </div>
                    <div id="cell7">
                        <div id="cell8">
                            <div align="left"><img src="../images/article_list.png" alt="" width="200" height="70" /></div>
                        </div>
                        <div id="cell9"> 
                            <div>
                                <%if (list.size() != 0) {%>
                                <table width="578" border="1">
                                    <%for (int i = 0; i < list.size(); i++) {
                                            Article a = (Article) list.get(i);
                                    %>
                                    <tr>
                                        <th width="1000" scope="col"><%=a.getName()%></th>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <%}%>
                                </table>
                                <%} else {%>
                                查無資料！
                                <%}%>

                            </div>

                        </div>

                    </div>
                    <div id="cell10">
                        <div align="center" >
                            <p>&nbsp;</p>
                            <p>YOUR JOURNAL資訊    版權所有 © 2011 YOURNAL! Taiwan All Rights Reserved </p>
                        </div></div>
                </div>

            </div>
            <div id="cell2"></div>
        </div>
    </body>
</html>